package com.wyl.mapper;

import java.util.Date;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.wyl.model.Detail;

@Mapper
public interface DetailMapper {

	@Select("select * from `news_detail` where id= #{id}")
	public Detail selectById(@Param("id")Integer id);
	
	@Insert("insert into `news_detail` (`simple_id`,`title`,`time`,`from`,`old_title`,`content`) values"
			+ "(#{simple_id},#{title},#{time},#{from},#{oldTitle},#{content})")
	public void save(
			@Param("simple_id")int simpleId,
			@Param("title")String title,
			@Param("time")Date time,
			@Param("from")String from,
			@Param("oldTitle")String oldTitle,
			@Param("content")String content);
	
	@Delete("truncate table `news_detail`")
	public void clear();
}
